/*
 * Copyright (C) 2017 Pingan, Inc. All Rights Reserved.
 */

package com.pingan.haofang.searchcloud.web.index.form;

import com.pingan.haofang.searchcloud.common.form.PageForm;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 索引调度查询条件
 *
 * @author zhangbi617
 * @date 18/05/2017
 */
@ApiModel(description = "索引调度查询条件")
public class IndexScheduleForm extends PageForm {

    /**
     * 索引ID
     */
    @ApiModelProperty(value = "索引ID", required = true)
    @NotNull
    private Long indexId;

    /**
     * 启动时间最早
     */
    @ApiModelProperty(value = "启动时间最早,格式：yyyy-MM-dd HH:mm:ss", required = true, example = "2017-05-18 09:44:55")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull
    private Date beginDate;

    /**
     * 启动时间最晚
     */
    @ApiModelProperty(value = "启动时间最晚，格式：yyyy-MM-dd HH:mm:ss", required = true, example = "2017-05-18 09:44:55")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull
    private Date endDate;

    /**
     * 执行状态 0：待执行 1：执行中 2：成功 3：失败
     *
     * @see com.pingan.haofang.searchcloud.index.constants.IndexBuildStatus
     */
    @ApiModelProperty("执行状态 0：待执行 1：执行中 2：成功 3：失败")
    private Integer status;

    public Long getIndexId() {
        return indexId;
    }

    public void setIndexId(Long indexId) {
        this.indexId = indexId;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "IndexScheduleForm{" +
                "indexId=" + indexId +
                ", beginDate=" + beginDate +
                ", endDate=" + endDate +
                ", status=" + status +
                "} " + super.toString();
    }
}
